package com.sgb.packers.base;

import com.alibaba.android.arouter.launcher.ARouter;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.swgk.core.BaseAppApplication;
import com.swgk.core.base.api.BaseApiSourceImpl;
import com.swgk.core.customview.MyLoadFooter;
import com.swgk.core.customview.MyRefreshHeader;
import com.swgk.core.util.MLog;
import com.swgk.core.util.SharedPreferenceUtil;

/**
 * @date 2021/6/8
 * @author younghow
 * Description:
 */
public class PackersBaseApplication extends BaseAppApplication {

    @Override
    protected BaseApiSourceImpl getApiSoure() {
        return null;
    }

    @Override
    protected String getBaseUrl() {
        return null;
    }

    @Override
    protected String getDbPath() {
        return null;
    }

    @Override
    protected <T> Class<T> getPreferenceSourceClass() {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        if (MLog.DEBUG_LOG) {
            ARouter.openLog();
            ARouter.openDebug();
        }
        ARouter.init(this);
        SharedPreferenceUtil.init(this);
        //添加刷新控件统一头部
        SmartRefreshLayout.setDefaultRefreshHeaderCreator((context, layout) -> new MyRefreshHeader(context));
        SmartRefreshLayout.setDefaultRefreshFooterCreator((context, layout) -> new MyLoadFooter(context));
    }

}
